package dao

import "github.com/worryry/8-pigeons/pkg/database/mysql"

func Create(data interface{}) error {
	err := mysql.DB.Create(&data).Error
	if err != nil {
		return err
	}
	return nil
}

func CreateByField(fields string, data interface{}) {
	//mysql.DB.Select("Name", "Age", "CreatedAt").Create(&user)
	mysql.DB.Select(fields).Create(data)
}
